<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div style="width: 300px;height: 500px;border: 1px;margin-left: 600px" >
    <h1>首页1</h1>

    <!--如果登录-->
    <div sec:authorize="isAuthenticated()">
        <a class="item" th:href="@{/logout}">
            <i class="address card icon"></i> 注销
        </a>
    </div>

    <!--如果没有登录-->
    <div sec:authorize="!isAuthenticated()">
        <a class="item" th:href="@{/toLogin}">
            <i class="address card icon"></i> 登录
        </a>
    </div>


    <div sec:authorize="hasRole('vip1')">
        <h3>User</h3>
        <hr/>
        <div><a th:href="@{/user/toAdd}">去add</a></div>
        <div><a th:href="@{/user/toUpdate}">去update</a></div>
    </div>

    <div sec:authorize="hasRole('vip2')">
        <h3>Order</h3>
        <hr/>
        <div><a th:href="@{/order/toAdd}">去add</a></div>
        <div><a th:href="@{/order/toUpdate}">去update</a></div>
    </div>
</div>
</body>
</html>